<template>
  <div>
    <a-modal
      title="添加产品"
      width="80%"
      :visible="visible"
      :destroyOnClose="true"
      @ok="confirm"
      @cancel="cancel"
    >
      <pro-table ref="proTable" @ok="handleOk"/>
    </a-modal>
  </div>
</template>

<script>
import proTable from '@/views/main/pro/index.vue'
export default {
  name: 'ProplanComp',
  components: {
      proTable
    },
    data() {
      return {
        // 是否可见
        visible: false
      }
    },
    methods: {
      open() {
        this.visible = true
      },
      confirm() {
        this.$emit('confirm', this.$refs.proTable.getSelectedRows())
        this.visible = false
      },
      cancel() {
        this.visible = false
      },
      handleOk() {
        this.$emit('ok')
      }
    }
}
</script>

<style>

</style>
